import request from '@/utils/request'

// 查询传感器列表
export function listSensorinfo(query) {
  return request({
    url: '/snmp/sensorinfo/list',
    method: 'get',
    params: query
  })
}

// 查询传感器列表
export function listAllSensorinfo(query) {
  return request({
    url: '/snmp/sensorinfo/list/all',
    method: 'get'
  })
}

// 查询传感器详细
export function getSensorinfo(sensorId) {
  return request({
    url: '/snmp/sensorinfo/' + sensorId,
    method: 'get'
  })
}
// 查询传感器详细
export function getSensorinfoByDeviceId(deviceId) {
  return request({
    url: '/snmp/sensorinfo/byDevice/' + deviceId,
    method: 'get'
  })
}

export function alllistSensorinfo(deviceId) {
  return request({
    url: '/snmp/sensorinfo/list/' + deviceId,
    method: 'get'
  })
}
// 新增传感器
export function addSensorinfo(data) {
  return request({
    url: '/snmp/sensorinfo',
    method: 'post',
    data: data
  })
}

// 修改传感器
export function updateSensorinfo(data) {
  return request({
    url: '/snmp/sensorinfo',
    method: 'put',
    data: data
  })
}

// 删除传感器
export function delSensorinfo(sensorId) {
  return request({
    url: '/snmp/sensorinfo/' + sensorId,
    method: 'delete'
  })
}
